/**
 * 铅笔的基类
 */
import Sprite from '../base/Sprite.js'
import DataStore from '../base/DataStore.js'
// import Director from '../Director.js'

export default class extends Sprite {
  constructor(img, top) {
    super(
      img,
      0, 0,
      img.width, img.height,
      DataStore.getInstance().canvas.width, 0,
      img.width, img.height
    )
    this.top = top
    this.moveSpeed = 2
    // this.moveSpeed = Director.getInstance().moveSpeed
  }
  draw() {
    this.x = this.x - this.moveSpeed
    super.draw(
      this.img,
      0, 0,
      this.width, this.height,
      this.x, this.y,
      this.width, this.height)
  }
}
